<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRcUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('rc_user', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->default('')->comment('昵称');
            $table->string('open_id')->default('')->comment('open_id');
            $table->string('head_img')->default('')->comment('头像');
            $table->string('insert_time')->default('')->comment('app创建时间');
            $table->integer('luck_sum')->default(1)->nullable()->comment('抽奖次数');
            $table->string('login_time')->nullable()->comment('最后登录时间');
            $table->unique(['open_id']);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('rc_user');
    }
}
